const mongoose = require('mongoose');
const { ObjectId } = mongoose.Schema;

/**
 * Export model definition object.
 */
module.exports = {
  functionId: ObjectId,
  fileId: ObjectId,
  filePath: String,
  line: Number,
  column: Number,
  message: String,
  // “paths”字段记录了一些路径的集合，因为此处的错误可能会在多条运行路径中发生。
  paths: [[{
    note: String,
    fileId: ObjectId,
    filePath: String,
    line: Number,
    column: Number,
  }]],
  // “proven”字段为真时表示该错误在该路径下一定发生。
  proved: Boolean,
  rule: Number,
  versionId: ObjectId,
};
